<?php

namespace App\Http\Requests\Article;

use Illuminate\Foundation\Http\FormRequest;

class InfoRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            'id'   => 'required|exists:swt_article,id',
        ];
    }

    public function messages()
    {
        return [
            'id.required'     => '文章ID必传',
            'id.exists'       => '文章不存在',
        ];
    }
}
